/**
 * Created by Yu Jin Xian on 2016/12/13.
 */
var express = require('express');
var handlebars = require('express3-handlebars').create({defaultLayout: 'main'});

var app = express();
app.engine('handlebars', handlebars.engine);
app.set('view engine', 'handlebars');

app.get('/foo', function (req, res) {
    res.render('foo');
});

app.get('/foo-no-layout', function (req, res) {
    res.render('foo', {layout: null});
});

app.get('/foo-other-layout', function (req, res) {
    res.render('foo', {layout: 'microsite'});
});

app.get('/foo-bootstrap', function (req, res) {
    res.render('foo', {layout: 'bootstrap'});
});

app.listen(3000, function () {
    console.log('http://localhost:3000/foo-no-layout');
});